package com.qf.day15.inter;

public class CollectoinTestUtils {

    public static void main(String[] args) {

        InsertabelLinkedListImpl insertabelLinkedList = new InsertabelLinkedListImpl();
        CollectoinTestUtils.testInsert(insertabelLinkedList,1000000);

        InsertabelArrayListImpl insertabelArrayList = new InsertabelArrayListImpl();
        CollectoinTestUtils.testInsert(insertabelArrayList,1000000);

    }

    public static void testInsert(Insertable insertData,Integer count){
        long start = System.currentTimeMillis();
        for (int i = 0; i < count; i++) {
            insertData.insert(i);
        }
        long end = System.currentTimeMillis();
        System.out.println("time used:"+(end-start));

    }


}
